package com.ceba.test.modules.regist.service;

import com.ceba.base.web.service.IBaseService;
import com.ceba.test.modules.regist.dao.EnterpriseDao;
import com.ceba.test.modules.regist.entity.Enterprise;

public class EnterpriseService extends IBaseService{
	
	private EnterpriseDao enterpriseDao;
	
	
	/**
	 * 添加一条记录
	 * @return
	 */
	public Boolean add(Enterprise enterprise) throws Exception{
		return enterpriseDao.add(enterprise);
	}
	
	
	/**
	 * 删除一条数据
	 * @param id 数据id
	 * @return
	 */
	public Boolean delete(String id) throws Exception{
	
		return enterpriseDao.delete(id);
	}
	
	public Boolean deleteByName(String enterpriseName) throws Exception{
		return enterpriseDao.deleteByName(enterpriseName);
	}
	/**
	 * @return 公司名称唯一
	 */
	public Enterprise getEnterprise(String user,String email,String phone) throws Exception{
	
		return enterpriseDao.getEnterprise(user, email, phone);
	}
	
	public boolean checkExistByNameAndActivateCode(String enterpriseName,String code) throws Exception{
	 return enterpriseDao.checkExistByNameAndActivateCode(enterpriseName, code);
	}


	public Enterprise getEnterpriseByName(String enterpriseName)throws Exception {

		return enterpriseDao.getEnterpriseByName(enterpriseName);
	}


	
	
	public EnterpriseDao getEnterpriseDao() {
		return enterpriseDao;
	}


	public void setEnterpriseDao(EnterpriseDao enterpriseDao) {
		this.enterpriseDao = enterpriseDao;
	}
	
	
}
